{extend name='extra@admin/content'}
{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">
    <a href='javascript:history.back(-1)' class='layui-btn layui-btn-small' style="text-decoration:none" onclick="daochu();">返回</a>
</div>
{/block}
{block name="content"}
<!-- 表单搜索 开始 -->
<form class="animated form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">变更时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}"
                   placeholder="请选择变更时间" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='text-left nowrap'>商品</th>
                <th class='text-left nowrap'>属性</th>
                <th class='text-left nowrap'>门店</th>
                <th class='text-left nowrap'>类型</th>
                <th class='text-left nowrap'>变更数</th>
                <th class='text-left nowrap'>当前库存</th>
                <th class='text-left nowrap'>操作时间</th>
                <!-- <th class='text-left nowrap'>排序</th> -->
                <!-- <th class='text-left nowrap'>操作</th> -->
            </tr>
        </thead>
        <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='text-left nowrap'>
                    {$vo.name}
                </td>
                <td class='text-left nowrap'>
                    {if condition="!empty($vo.spec)"}{$vo.spec}{else /}无属性{/if}
                </td>
                <td class='text-left nowrap'>
                    {if condition="!empty($vo.title)"}{$vo.title}{else /}总部{/if}
                </td>
                <td class='text-left nowrap'>
                    {if condition="$vo['sign'] eq 1"}进货
                    {elseif condition="$vo['sign'] eq 2" /}门店申请
                    {else /}报损
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if condition="$vo['type'] eq 1"}+{else /}-{/if}{if condition="$vo.sign eq 1"}{$vo.rec_num}{elseif condition="$vo.sign eq 2"/}{$vo.rec_num}{else /}{$vo.dif_num}{/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.cur_num}
                </td>
                <td class='text-left nowrap'>
                    {$vo.addtime|date="Y-m-d",###}
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}